package org.jeecg.modules.solitaire_app.utils;

import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.FileItem;
import com.alipay.api.request.DatadigitalFincloudGeneralsaasFaceCertifyInitializeRequest;
import com.alipay.api.request.DatadigitalFincloudGeneralsaasFaceSourceCertifyRequest;
import com.alipay.api.response.DatadigitalFincloudGeneralsaasFaceCertifyInitializeResponse;
import com.alipay.api.response.DatadigitalFincloudGeneralsaasFaceSourceCertifyResponse;
import org.jeecg.common.api.vo.Result;

public class AliPayClientUtil {

//    public Result<?> aliPayClient() throws AlipayApiException {
//        AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do","app_id","MIIEowIBAAKCAQEAl4jG/iXXrGluooL6WVuLRKv67q2BhBHLeU/nYIB9NcIHDOrMwP4OyOqpQL/52hPzSREmumesc1zrslXu6xZEQDP6cPTwYq3nGaSPRtxv7Td3C0OXbKYjj6MGNuVMufVc8MYLnQU1zs24mR9n29avnUVL8QH5N/YfPGWNFo1qbrI5zDRkxr+j82jF4QdTeLVxXJ7bk2f8ueVOpurwDnTPIUkLkJw/6we3n1TDX6ZH/uujtiV4C28B8K0gvkp9fd6h6P2xG6ZjirEcbxr5l9m2yFK3y+Igl8qc/6WFjjLYVtaGwL0nxre4fEo3r4eCRn/0qDj34SGSVYU/kyxl8aiW3wIDAQABAoIBAC2VvN8JfUbldJ24rx0gd9XRsqwIT/Tt8Xrt+ZnDLWd1le9h1vSbuNDiHsZWug/Lfp1VZoQe2fbeVh0Q0s2vphp2SHmghYv56pKBOYTEnXsL+2jNDYlmtT3ped4bvqgWUr4vpaC3x4cNxeFyXCj6/VtfVEgNIu6dwKnHltjY89KWnMiQ7577o+nOxVwNB2NJkUGmSay7B0ErQCUKaoPFSNpGvWCGvdzXRl9IZjF4QnoZCbZQN8lNRBtdA0/HTTampJwECGOFZ8t8T4/YJnQh+BUJGyw1BX4F3aVRta/sgzu9ztiG3rVSVlR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j6MGNuVMufVc8MYLnQU1zs24mR9n29avnUVL8QH5N/YfPGWNFo1qbrI5zDRkxr+j82jF4QdTeLVxXJ7bk2f8ueVOpurwDnTPIUkLkJw/6we3n1TDX6ZH/uujtiV4C28B8K0gvkp9fd6h6P2xG6ZjirEcbxr5l9m2yFK3y+Igl8qc/6WFjjLYVtaGwL0nxre4fEo3r4eCRn/0qDj34SGSVYU/kyxl8aiW3wIDAQAB","RSA2");
//        DatadigitalFincloudGeneralsaasFaceCertifyInitializeRequest request = new DatadigitalFincloudGeneralsaasFaceCertifyInitializeRequest();
//        request.setBizContent("{" +
//                "  \"outer_order_no\":\"ZGYD201809132323000001234\"," +
//                "  \"biz_code\":\"FUTURE_TECH_BIZ_FACE_SDK\"," +
//                "  \"identity_param\":\"{ \\\"identity_type\\\": \\\"CERT_INFO\\\", \\\"cert_type\\\": \\\"IDENTITY_CARD\\\", \\\"cert_name\\\": \\\"收委\\\",\\\"cert_no\\\": \\\"260104197909275964\\\",\\\"phone_no\\\":\\\"13000000000\\\"}\"," +
//                "  \"merchant_config\":\"{\\\"return_url\\\":\\\"xxx\\\"}\"" +
//                "}");
//        DatadigitalFincloudGeneralsaasFaceCertifyInitializeResponse response = alipayClient.execute(request);
//        if(response.isSuccess()){
//            System.out.println("调用成功");
//        } else {
//            System.out.println("调用失败");
//        }
//    }
public static void main(String[] args) throws AlipayApiException {
    AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do","app_id","MIIEowIBAAKCAQEAl4jG/iXXrGluooL6WVuLRKv67q2BhBHLeU/nYIB9NcIHDOrMwP4OyOqpQL/52hPzSREmumesc1zrslXu6xZEQDP6cPTwYq3nGaSPRtxv7Td3C0OXbKYjj6MGNuVMufVc8MYLnQU1zs24mR9n29avnUVL8QH5N/YfPGWNFo1qbrI5zDRkxr+j82jF4QdTeLVxXJ7bk2f8ueVOpurwDnTPIUkLkJw/6we3n1TDX6ZH/uujtiV4C28B8K0gvkp9fd6h6P2xG6Zj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zMDf6gJePHaWevM3NxOGj4TQrKrvOoSK6fP199XXnyN8P5mIdWkaL/mWQoSND5VAoGBANdSvUHBdgZK+eTfroJOEETMIMVVoqL4n2+W2Yes8RUa6n4iPuWjqIdbYgMdG0fBEftNQnh6+rzmi2QURoWS5oWu4l6WUJBVPIye7cNxVtKCDba1rjTqDUZuDVfaI8dCCvqEtTywn5D1xdsEf8Gq1AUn4Ji0KOqTIBI0W4etcHo7","json","GBK","MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAl4jG/iXXrGluooL6WVuLRKv67q2BhBHLeU/nYIB9NcIHDOrMwP4OyOqpQL/52hPzSREmumesc1zrslXu6xZEQDP6cPTwYq3nGaSPRtxv7Td3C0OXbKYjj6MGNuVMufVc8MYLnQU1zs24mR9n29avnUVL8QH5N/YfPGWNFo1qbrI5zDRkxr+j82jF4QdTeLVxXJ7bk2f8ueVOpurwDnTPIUkLkJw/6we3n1TDX6ZH/uujtiV4C28B8K0gvkp9fd6h6P2xG6ZjirEcbxr5l9m2yFK3y+Igl8qc/6WFjjLYVtaGwL0nxre4fEo3r4eCRn/0qDj34SGSVYU/kyxl8aiW3wIDAQAB","RSA2");
    DatadigitalFincloudGeneralsaasFaceCertifyInitializeRequest request = new DatadigitalFincloudGeneralsaasFaceCertifyInitializeRequest();
    request.setBizContent("{" +
            "  \"outer_order_no\":\"ZGYD201809132323000001234\"," +
            "  \"biz_code\":\"FUTURE_TECH_BIZ_FACE_SDK\"," +
            "  \"identity_param\":\"{ \\\"identity_type\\\": \\\"CERT_INFO\\\", \\\"cert_type\\\": \\\"IDENTITY_CARD\\\", \\\"cert_name\\\": \\\"收委\\\",\\\"cert_no\\\": \\\"260104197909275964\\\",\\\"phone_no\\\":\\\"13000000000\\\"}\"," +
            "  \"merchant_config\":\"{\\\"return_url\\\":\\\"xxx\\\"}\"" +
            "}");
    DatadigitalFincloudGeneralsaasFaceCertifyInitializeResponse response = alipayClient.execute(request);
    if(response.isSuccess()){
        System.out.println("调用成功");
    } else {
        System.out.println("调用失败");
    }
}
}
